﻿using System.ComponentModel;
using System.Xml;
using System.Xml.Serialization;

namespace Bpmn.Xml;

/// <remarks/>
[XmlInclude(typeof(GlobalConversation))]
[XmlInclude(typeof(Choreography))]
[XmlInclude(typeof(GlobalChoreographyTask))]
[Serializable]
[XmlType(Namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", TypeName = "tCollaboration")]
[XmlRoot("collaboration", Namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", IsNullable = false)]
public partial class Collaboration : RootElement
{
    /// <remarks/>
    [XmlElement("participant")]
    public Participant[] Participant { get; set; } = default!;

    /// <remarks/>
    [XmlElement("messageFlow")]
    public MessageFlow[] MessageFlow { get; set; } = default!;

    /// <remarks/>
    [XmlElement("artifact", typeof(Artifact))]
    [XmlElement("association", typeof(Association))]
    [XmlElement("group", typeof(Group))]
    [XmlElement("textAnnotation", typeof(TextAnnotation))]
    public Artifact[] Items { get; set; } = default!;

    /// <remarks/>
    [XmlElement("callConversation", typeof(CallConversation))]
    [XmlElement("conversation", typeof(Conversation))]
    [XmlElement("conversationNode", typeof(ConversationNode))]
    [XmlElement("subConversation", typeof(SubConversation))]
    public ConversationNode[] Items1 { get; set; } = default!;

    /// <remarks/>
    [XmlElement("conversationAssociation")]
    public ConversationAssociation[] ConversationAssociation { get; set; } = default!;

    /// <remarks/>
    [XmlElement("participantAssociation")]
    public ParticipantAssociation[] ParticipantAssociation { get; set; } = default!;

    /// <remarks/>
    [XmlElement("messageFlowAssociation")]
    public MessageFlowAssociation[] MessageFlowAssociation { get; set; } = default!;

    /// <remarks/>
    [XmlElement("correlationKey")]
    public CorrelationKey[] CorrelationKey { get; set; } = default!;

    /// <remarks/>
    [XmlElement("choreographyRef")]
    public XmlQualifiedName[] ChoreographyRef { get; set; } = default!;

    /// <remarks/>
    [XmlElement("conversationLink")]
    public ConversationLink[] ConversationLink { get; set; } = default!;

    /// <remarks/>
    [XmlAttribute("name")]
    public string Name { get; set; } = default!;

    /// <remarks/>
    [XmlAttribute("isClosed")]
    [DefaultValue(false)]
    public bool IsClosed { get; set; } = false;
}
